cd.grupos               package:MRQ                R Documentation

	Function to show density graph of two variables

Description:

     The function is to show the behavior when two variables are grouped according to a categorical variable. 

Usage:

     cd.grupos(x,col=2,grupos=1)

Arguments:

 x	only accepts as argument a database of class data.frame
 col	by default, col = 2, which means the number of the column 		containing the sample of the interest variableby
 grupos	by default, groups = 1, which means the column number that is 		of the categorical variableby

Details:

     	Used to check visually as "n" different groups behavior

Value:

 By default, the function returns:
	By default, the function returns:	
	A graph, which shows density plots of each group at the same 		device, to make comparison


Warning:
 col	serves only for the values ​​1, 2, 3 and 4, corresponding 	to the column number it will use
 grupos serves only for the values ​​1, 2, 3 and 4, corresponding to the 		column number it will use



Author(s):

     Mariana Ramos Queiroz (mrq.vet@gmail.com)


See Also:

	ggplot()
	
Examples: 
	# Creating a random values for a data base 
	sexo <- c(rep('M',each=50),rep('H',50))
	peso.m.h <- c(rnorm(50,60,12),rnorm(50,70,16))
	altura.m.h <- c(rnorm(50,160.07,3.55),rnorm(50,172.2,2.5))
	idade <- sample(rnorm(100,26.85,0.55))

	# Creating data.frame
	vari1 <- data.frame(sexo,peso.m.h,altura.m.h,idade)
	vari2 <- data.frame(peso.m.h,sexo,altura.m.h,idade)
	vari3 <- data.frame(peso.m.h,altura.m.h,sexo,idade)
	vari4 <- data.frame(peso.m.h,altura.m.h,idade,sexo)
	
	# Groups in column 1
	x<-vari1
	cd.grupos(vari1,col=3,grupos=1)
	
	# Groups in column 2
	x<-vari2
	cd.grupos(vari2,col=3,grupos=2)

	# Groups in column 3
	x<-vari3
	cd.grupos(vari3,col=2,grupos=3)

	# Groups in column 4
	x<-vari4
	cd.grupos(vari4,col=2,grupos=4)
